/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/


package org.jfab.core.alert;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;


/**
 * <p>Java class for Alert complex type.
 *
 * <p>The following schema fragment specifies the expected content contained
 * within this class.
 *
 * <pre>
   &lt;complexType name="Alert">
     &lt;complexContent>
       &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         &lt;sequence>
           &lt;element name="alertReference" type="{http://www.w3.org/2001/XMLSchema}string"/>
           &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string"/>
           &lt;element name="node" type="{http://www.w3.org/2001/XMLSchema}string"/>
           &lt;element name="role" type="{http://www.w3.org/2001/XMLSchema}string"/>
           &lt;element name="alertDetail" type="{http://www.wildblue.viasat.com/XMLSchema/v3.0/webservice/AlertService}AlertDetail" maxOccurs="unbounded"/>
           &lt;element name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
           &lt;element name="trackingKey" type="{http://www.w3.org/2001/XMLSchema}string"/>
         &lt;/sequence>
       &lt;/restriction>
     &lt;/complexContent>
   &lt;/complexType>
 * </pre>
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
    name = "Alert",
    propOrder =
        {
            "alertReference", "code", "node", "role", "alertDetails",
            "timestamp", "trackingKey"
        }
)
public class AlertXml
{
    /** Alert details. */
    @XmlElement(
        name = "alertDetail",
        required = true
    )
    protected List<AlertDetailXml> alertDetails;

    /** Alert reference. */
    @XmlElement(required = true)
    protected String alertReference;

    /** Code. */
    @XmlElement(required = true)
    protected String code;

    /** Node. */
    @XmlElement(required = true)
    protected String node;

    /** Role. */
    @XmlElement(required = true)
    protected String role;

    /** Timestamp. */
    @XmlElement(
        required = true,
        type = String.class
    )
    @XmlSchemaType(name = "dateTime")
    protected Date timestamp;

    /** Tracking key. */
    @XmlElement(required = true)
    protected String trackingKey;

    /**
     * Gets the value of the alertDetails property.
     *
     * <p>This accessor method returns a reference to the live list, not a
     * snapshot. Therefore any modification you make to the returned list will
     * be present inside the JAXB object. This is why there is not a <CODE>
     * set</CODE> method for the alertDetails property.
     *
     * <p>For example, to add a new item, do as follows:
     *
     * <pre>
          getAlertDetails().add(newItem);
     * </pre>
     *
     * <p>Objects of the following type(s) are allowed in the list {@link
     * AlertDetailXml}
     *
     * @return  data.
     */
    public List<AlertDetailXml> getAlertDetails()
    {
        if (alertDetails == null)
        {
            alertDetails = new ArrayList<AlertDetailXml>();
        }

        return this.alertDetails;
    }

    /**
     * Gets the value of the alertReference property.
     *
     * @return  possible object is {@link String }
     */
    public String getAlertReference()
    {
        return alertReference;
    }

    /**
     * Gets the value of the code property.
     *
     * @return  possible object is {@link String }
     */
    public String getCode()
    {
        return code;
    }

    /**
     * Gets the value of the node property.
     *
     * @return  possible object is {@link String }
     */
    public String getNode()
    {
        return node;
    }

    /**
     * Gets the value of the role property.
     *
     * @return  possible object is {@link String }
     */
    public String getRole()
    {
        return role;
    }

    /**
     * Gets the value of the timestamp property.
     *
     * @return  possible object is {@link String }
     */
    public Date getTimestamp()
    {
        return timestamp;
    }

    /**
     * Gets the value of the trackingKey property.
     *
     * @return  possible object is {@link String }
     */
    public String getTrackingKey()
    {
        return trackingKey;
    }

    /**
     * Sets the value of the alertReference property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setAlertReference(String value)
    {
        this.alertReference = value;
    }

    /**
     * Sets the value of the code property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setCode(String value)
    {
        this.code = value;
    }

    /**
     * Sets the value of the node property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setNode(String value)
    {
        this.node = value;
    }

    /**
     * Sets the value of the role property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setRole(String value)
    {
        this.role = value;
    }

    /**
     * Sets the value of the timestamp property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setTimestamp(Date value)
    {
        this.timestamp = value;
    }

    /**
     * Sets the value of the trackingKey property.
     *
     * @param  value  allowed object is {@link String }
     */
    public void setTrackingKey(String value)
    {
        this.trackingKey = value;
    }
}
